<!DOCTYPE html
          PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html   xmlns   = "http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type" />
<link rel="STYLESHEET" href="filtersdk.css" type="text/css" />
<title>Colorspace properties - AviSynth</title>
</head>
<body>

<h1>Colorspace properties</h1>

<p>In AviSynth v2.60, the colorspace properties are:</p>
<pre> // Colorspace properties.
 enum {
   CS_BGR               = 1&lt;&lt;28,
   CS_YUV               = 1&lt;&lt;29,
   CS_INTERLEAVED       = 1&lt;&lt;30,
   CS_PLANAR            = 1&lt;&lt;31,

   CS_VPlaneFirst       = 1&lt;&lt;3
   CS_UPlaneFirst       = 1&lt;&lt;4

   CS_Shift_Sub_Width   =  0
   CS_Shift_Sub_Height  =  8
   CS_Shift_Sample_Bits = 16

   CS_Sub_Width_1       = 3 &lt;&lt; CS_Shift_Sub_Width,  // YV24
   CS_Sub_Width_2       = 0 &lt;&lt; CS_Shift_Sub_Width,  // YV12, I420, YV16
   CS_Sub_Width_4       = 1 &lt;&lt; CS_Shift_Sub_Width,  // YUV9, YV411

   CS_Sub_Height_1      = 3 &lt;&lt; CS_Shift_Sub_Height, // YV16, YV24, YV411
   CS_Sub_Height_2      = 0 &lt;&lt; CS_Shift_Sub_Height, // YV12, I420
   CS_Sub_Height_4      = 1 &lt;&lt; CS_Shift_Sub_Height, // YUV9

   CS_Sample_Bits_8     = 0 &lt;&lt; CS_Shift_Sample_Bits,
   CS_Sample_Bits_16    = 1 &lt;&lt; CS_Shift_Sample_Bits,
   CS_Sample_Bits_32    = 2 &lt;&lt; CS_Shift_Sample_Bits,
 };

 // Specific colorformats
 enum {
   CS_UNKNOWN = 0,
   CS_BGR24 = 1&lt;&lt;0 | CS_BGR | CS_INTERLEAVED,
   CS_BGR32 = 1&lt;&lt;1 | CS_BGR | CS_INTERLEAVED,
   CS_YUY2  = 1&lt;&lt;2 | CS_YUV | CS_INTERLEAVED,
   CS_RAW32 = 1&lt;&lt;5 | CS_INTERLEAVED,
   CS_YV24  = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_1,  // YUV 4:4:4 planar
   CS_YV16  = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_2,  // YUV 4:2:2 planar
   CS_YV12  = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2,  // y-v-u, 4:2:0 planar
   CS_I420  = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_UPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2,  // y-u-v, 4:2:0 planar
   CS_IYUV  = CS_I420,
   CS_YUV9  = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_4 | CS_Sub_Width_4,  // YUV 4:1:0 planar
   CS_YV411 = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_1 | CS_Sub_Width_4,  // YUV 4:1:1 planar
   CS_Y8    = CS_PLANAR | CS_INTERLEAVED | CS_YUV | CS_Sample_Bits_8,                                     // Y   4:0:0 planar
 };</pre>
<p>Thus CS_YV12 gives for example:</p>
<pre> CS_YV12  = CS_PLANAR | CS_YUV | CS_Sample_Bits_8 | CS_VPlaneFirst | CS_Sub_Height_2 | CS_Sub_Width_2
          = 1&lt;&lt;31 | 1&lt;&lt;29 | 0&lt;&lt;16 | 1&lt;&lt;3 | 0&lt;&lt;8 | 0&lt;&lt;0
          = 1010.0000.0000.0000.0000.1000</pre>
Back to <a href="FilterSDK.htm">FilterSDK</a> | <a href="VideoInfo.htm">VideoInfo</a>
<p><kbd>$Date: 2015/01/13 00:24:50 $<br>
</kbd></p>
</body>
</html>
